<?php

if($_POST['task'] == 'existuser')
{  makeUserLogin($Errors, $_POST['email'], $_POST['pass']);
  if(isEmptyArr($Errors))
  {
  	if(!isBlank($_GET['r']))
  	{  	  go_to(urldecode($_GET['r']));
  	}
  	else
  	{
  	  go_to(getPath().$CONFIG['UserPage'].$CONFIG['webPageFileType']);
  	}
  	exit;
  }
}

$ErrorMessages = array();
foreach($Errors as $n => $error)
{  $ErrorMessages[] = $ERRORS['user'][$error];
}
$tpl->assign("ErrorMessages", $ErrorMessages);
$tpl->assign("task", $_POST['task']);

$tpl->assign("PageTitle", $language['user']['login']);

$_BODY_SMARTY_TEMPLATE = $CONFIG['ModulesFolder']."module.login.tpl";

?>